<?php
if (isset($_SESSION['daima']) && isset($_POST['name']) && !empty($_POST['name'])){
    include '../c/config.php';
   
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
    $name=addslashes(trim($_POST['name'])); 

    $query=$mysqli->query("SELECT id,school,name,nianji,kc,qu from `app_student` where name='".$name."' limit 0,6 ");
    if($query->num_rows>0){
        $user=array();
        while($list =$query->fetch_array()){
            $user[]= array('id'=>$list['id'],'school'=>$list['school'],'name'=>$list['name'],'nianji'=>$list['nianji'],'kc'=>$list['kc'],'qu'=>$list['qu']);
        }
       // $_SESSION['ids']=$userInfo['id'];
        echo json_encode(array('status'=>'ok','u'=>$user));
        exit;
    }else{
        $_SESSION['ids']=NULL;
        echo json_encode(array('status'=>'not'));
        exit;
    }
    
}
